const fs = require('fs');
const path = require('path');

module.exports = async(params) => {
    const {
<<<<<<< HEAD
        quickAddApi,
        app
    } = params;
=======
        quickAddApi: {inputPrompt},
        app
    };
>>>>>>> 3867d9fcac1247ace4730e7403ec34af5a3ff2a3
    const editor = app.workspace.activeEditor?.editor;
    if (!editor) {
        new Notice("无可用编辑器");
        return;
    }
    const selectedText = editor.getSelection();
    if (!selectedText){
        new Notice("未选中任何内容");
        return ;
    }
    if (!fs.existsSync(selectedText)){
        fs.mkdirSync(selectedText,{recursive:true});
<<<<<<< HEAD
        new Notice(`成功新建目录${selectedText}`);
    } else {
        new Notice(`目录${selectedText}已存在`);
=======
>>>>>>> 3867d9fcac1247ace4730e7403ec34af5a3ff2a3
    }
}